/**
 * @module 请求配置 
 */

import Axios from 'axios';
import Serve from './mockData';

const BASE_CONFIG = {
    baseURL: '/',
};

import Vue from 'vue';

const $http = Axios.create(BASE_CONFIG);

const buildGET = (url) =>{
    return (params) => $http.get(url, params);
}

const API = {

    //首页主海报
    getBanner: Serve('/bannes'),
    
    //首页推荐
    getRecommend: Serve('/recommend'),

    // 二手车列表
    getCarList: Serve('/cars'),

    // 车辆明细
    getCarDetailed: Serve('/cars/id'),
    
    // 服务列表
    getServeList: Serve('/serves'),

    // 服务明细
    getServeDetailed: Serve('/serves/id'),

};


// 全局绑定
Vue.prototype.$http = $http;
Vue.prototype.$API = API;

export default $http;
export {API};
